package per.qiao.simplechian.bo;

import lombok.Getter;
import lombok.Setter;

/**
 * @author: qiaoyp
 * @Date: 2024/8/21 18:58
 * @Description:
 */
@Getter
@Setter
public class NodeResult {

    /**
     * 单个节点的执行结果
     */
    private Object result;

    /**
     * 是否继续执行下一个节点
     */
    private boolean continueExec;

    private NodeResult(Object result) {
        this(result, true);
    }

    private NodeResult(Object result, boolean continueExec) {
        this.result = result;
        this.continueExec = continueExec;
    }

    public static NodeResult of(Object result) {
        return new NodeResult(result);
    }

    public static NodeResult of(Object result, boolean continueExec) {
        return new NodeResult(result, continueExec);
    }
}
